<?php
/**
 * Created by PhpStorm.
 * User: Hanson
 * Date: 2016/7/24
 * Time: 22:28
 */

namespace App\Handlers;


use App\Model\User;
use Config;
use EasyWeChat\Message\News;
use EasyWeChat\Message\Voice;

class WechatHandler implements HandlerInterface
{

    public static function run($message)
    {

        if($result = call_user_func_array(['App\Handlers\Middleware\WechatMiddleware', 'fire'], [$message])){
            return $result;
        }

        $handler = 'App\Handlers\\' . ucfirst($message->MsgType) . 'Handler';

        return call_user_func_array([$handler, 'run'], [$message]);
    }
}